<!--  -->
<template>
  <div class="charts" ref="charts"></div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'LineCharts',
  data() {
    return {}
  },

  components: {},
  mounted() {
    //初始化echarts实例
    let lineCharts = echarts.init(this.$refs.charts)
    //配置数组
    lineCharts.setOption({
      xAxis: {
        show: false, //隐藏X轴
        type: 'category', //均分
      },
      yAxis: {
        show: false, //隐藏Y轴
      },
      //系列
      series: [
        {
          type: 'line',
          data: [44, 7, 33, 12, 88, 9, 20, 33, 100, 22],
          //拐点样式设置
          itemStyle: {
            opacity: 0,
          },
          //曲线平滑
          smooth: true,
          //线条颜色
          lineStyle: {
            color: 'purple',
          },
          //区域填充颜色
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: 'purple', //百分之0出的颜色
                },
                {
                  offset: 1,
                  color: '#fff', //百分之100出的颜色
                },
              ],
              gobal: false,
            },
          },
        },
      ],
      //布局调试
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
    })
  },
  computed: {},

  methods: {},
}
</script>
<style lang='scss' scoped>
.charts {
  width: 100%;
  height: 100%;
}
</style>